package com.pms.utils;

import java.util.List;
/**
 *
 *  draw 绘制计数器
 *  recordsTotal 没有过滤的记录数（数据库里总共记录数）
 *  recordsFiltered 过滤后的记录数
 *  data 表中中需要显示的数据, 与datatales 加载的“dataSrc"对应
 *  error 错误来描述服务器出了问题后的友好提示
 */
public class DataTableResponse<T> {
    private int draw;
    private int recordsTotal;
    private int recordsFiltered;
    private List<T> data;
    private String error;
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("draw : " + draw);
        sb.append("recordsTotal : " + recordsTotal);
        sb.append("recordsFiltered : " + recordsFiltered);
        sb.append("error : " + error);
        return sb.toString();
    }
    public DataTableResponse() {
    }

    public DataTableResponse(int draw, int recordsTotal, int recordsFiltered, List<T> data, String error) {
        this.draw = draw;
        this.recordsTotal = recordsTotal;
        this.recordsFiltered = recordsFiltered;
        this.data = data;
        this.error = error;
    }

    public int getDraw() {
        return draw;
    }

    public void setDraw(int draw) {
        this.draw = draw;
    }

    public int getRecordsTotal() {
        return recordsTotal;
    }

    public void setRecordsTotal(int recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    public int getRecordsFiltered() {
        return recordsFiltered;
    }

    public void setRecordsFiltered(int recordsFiltered) {
        this.recordsFiltered = recordsFiltered;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }
}
